package com.faasadmin.faas.modules.admin.admin.controller.system.common;

import com.faasadmin.faas.business.core.module.system.service.captcha.SysCaptchaBussService;
import com.faasadmin.faas.business.core.module.system.vo.captcha.SysCaptchaImageRespVO;
import com.faasadmin.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static com.faasadmin.framework.common.pojo.CommonResult.success;

@Tag(name = "验证码")
@RestController
@RequestMapping("/system/captcha")
public class SysCaptchaController {

    @Resource
    private SysCaptchaBussService sysCaptchaBussService;

    @GetMapping("/get-image")
    @Operation(summary = "生成图片验证码")
    public CommonResult<SysCaptchaImageRespVO> getCaptchaImage() {
        return success(sysCaptchaBussService.getCaptchaImage());
    }

}
